package com.coolingme.general;

/**
 * 具体装饰器，扩展了Decorator对象的功能
 *
 * @author wangyue
 * @date 2020-09-15 22:51
 */
public class DecoratorConcreteA extends Decorator {

    public DecoratorConcreteA(Component component) {
        super(component);
    }

    /**
     * 实例方法前的操作
     */
    private void beforeOperation() {
        System.out.println("操作处理前：AAAAAA");
    }

    /**
     * 实例方法后的操作
     */
    private void afterOperation() {
        System.out.println("操作处理后：AAAAAA");
    }

    @Override
    public void operation() {
        beforeOperation();
        super.operation();
        afterOperation();
    }
}
